<template>
	<view>
		<!-- <u-tabbar :value="current" :placeholder="true" @change="tabbarChange" :fixed="true"
			:safeAreaInsetBottom="false" :activeColor="activeColor">
			<u-tabbar-item :text="item.text" :icon="item.iconPath" v-for="(item,index) in tabBarList"></u-tabbar-item>
		</u-tabbar> -->
		<u-tabbar :value="current?current:0" @change="tabbarChange" :fixed="true" :placeholder="true"
			:safeAreaInsetBottom="true" :activeColor="activeColor">
			<u-tabbar-item v-for="(item,index) in tabBarList" :key="index" :text="item.text">
				<image class="u-page__item__slot-icon" slot="inactive-icon" :src="item.iconPath"></image>
				<image class="u-page__item__slot-icon" slot="active-icon" :src="item.selectedIconPath"></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>
<script>
	import tabBar from '@/util/tabbar.js'
	import {
		mapMutations
	} from "vuex";
	export default {
		props: {
			current: {
				type: Number,
				default: 0
			},
			tabBarList: {
				type: Array,
				default: () => uni.getStorageSync('tabBarList') || tabBar[0]
			}
		},
		data() {
			return {
				borderTop: false,
				// inactiveColor: "#0F53AC",
				activeColor: "#0F53AC",
				List: []
			}
		},
		onLoad() {

		},
		methods: {
			...mapMutations(["setmenuStatus"]),
			tabbarChange(e) {
				this.List = uni.getStorageSync('tabBarList')
				// if(this.List[e].pagePath == 'pages/work/index'){
				// 	this.setmenuStatus(1)
				// }
				
				uni.switchTab({
					url: "/" + this.List[e].pagePath
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	image {
		width: 36rpx;
		height: 36rpx;
	}
</style>
